package com.everyday;

import java.util.ArrayList;
import java.util.List;

public class Solution1641 {
    char[] chars = new char[]{'a', 'e', 'i', 'o', 'u'};
    List<String> list = new ArrayList<>();
    public int countVowelStrings(int n) {
        backtracking(0, n);
        return list.size();
    }

    StringBuffer sb = new StringBuffer();
    public void backtracking(int index, int n) {
        if (sb.length() == n) {
            list.add(sb.toString());
            return;
        }
        for (int i = index; i < chars.length; i++) {
            sb.append(chars[i]);
            backtracking(i, n);
            sb.deleteCharAt(sb.length() - 1);
        }
    }
}
